//通用功能
#ifndef COMMON_UTIL_H_
#define COMMON_UTIL_H_
#include <Arduino.h>
#include <WiFiManager.h>  // https://github.com/tzapu/WiFiManager
#include <nvs_flash.h>

//最多多少个TCP客户端可以连接
#define MAX_TCP_CLIENTS 2

extern nvs_handle_t my_nvs_handle_t;

extern char* nvs_space;

extern WiFiClient serverClients[MAX_TCP_CLIENTS];
extern WiFiClient tcp_client;
extern uint8_t lcdr[16];

// 是否开启转发
extern uint8_t transmit;
extern void requestString(String request);

// 广播
void broadcast(String data);
uint8_t requestTest(String request);
void saveVlaueU8(char* key, uint8_t value);
void saveVlaueU16(char* key, uint16_t value);
void saveVlaueU32(char* key, uint32_t value);
void saveVlaueStr(char* key, char* value);
uint8_t s2h(char c);
char t2h(uint8_t i);
#endif